local bagualu_crossbow_skill = fk.CreateSkill {
  name = "#bagualu_crossbow_skill",
  tags = {Skill.Compulsory },
  attached_equip="bagualu_crossbow"
}



bagualu_crossbow_skill:addEffect("targetmod", {
  name = "#bagualu_crossbow_skill",
  bypass_times = function(self, player, skill, scope, card)
    if player:hasSkill(bagualu_crossbow_skill.name) and skill.trueName == "slash_skill" and scope == Player.HistoryPhase then
      local cardIds = Card:getIdList(card)
      local crossbows = table.filter(player:getEquipments(Card.SubtypeWeapon), function(id)
        return Fk:getCardById(id).name == bagualu_crossbow_skill.attached_equip
      end)
      return #crossbows == 0 or not table.every(crossbows, function(id)
        return table.contains(cardIds, id)
      end)
    end
  end,
})

return bagualu_crossbow_skill
